//
//  GYMineBuyOrderInfoVC.m
//  GYDemo
//
//  Created by mac on 2018/4/2.
//  Copyright © 2018年 mac. All rights reserved.
//

//
//                .-~~~~~~~~~-._       _.-~~~~~~~~~-.
//            __.'              ~.   .~              `.__
//          .'//                  \./                  \\`.
//        .'//                     |                     \\`.
//      .'// .-~"""""""~~~~-._     |     _,-~~~~"""""""~-. \\`.
//    .'//.-"                 `-.  |  .-'                 "-.\\`.
//  .'//______.============-..   \ | /   ..-============.______\\`.
//.'______________________________\|/______________________________`.
//
//

#import "GYMineBuyOrderInfoVC.h"
#import "Head.h"
@interface GYMineBuyOrderInfoVC ()<NBLScrollTabControllerDelegate>
@property (nonatomic,strong) NBLScrollTabController *segmentTV;
@property (nonatomic,strong) NSMutableArray *titleSource;
@property (nonatomic,strong) NSMutableArray *viewControllers;
@end

@implementation GYMineBuyOrderInfoVC

#pragma mark - getter and setter
-(NBLScrollTabController *)segmentTV
{
    if (!_segmentTV) {
        NBLScrollTabTheme *theme = [[NBLScrollTabTheme alloc] init];
        theme.titleViewBGColor = Main_Color_White;
        theme.titleColor = Main_Color_Black;
        theme.highlightColor = Main_Color_Red;
        theme.indicatorViewColor = Main_Color_Red;
        _segmentTV = [[NBLScrollTabController alloc] initWithTabTheme:theme];
        _segmentTV.view.frame = self.view.bounds;
        _segmentTV.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
        _segmentTV.delegate = self;
        _segmentTV.viewControllers = self.viewControllers;
    }
    return _segmentTV;
}
-(NSMutableArray *)titleSource
{
    if (!_titleSource) {
        _titleSource = [NSMutableArray new];
        [_titleSource addObject:@"全部"];
        [_titleSource addObject:@"已下单"];
        [_titleSource addObject:@"已完成"];
        [_titleSource addObject:@"已取消"];
        [_titleSource addObject:@"已评价"];
    }
    return _titleSource;
}
-(NSMutableArray *)viewControllers
{
    if (!_viewControllers) {
        _viewControllers = [NSMutableArray new];
        for (NSInteger i = 0; i < 5; i++) {
            GYMineOrderInfoSignalVC *signal = [GYMineOrderInfoSignalVC new];
            signal.viewModel.orderCatagery = @"0";
            NSString *index = [NSString stringWithFormat:@"%ld",i];
            if (i==0||i==1) {
                signal.viewModel.orderType = @"0";
            }else{
                signal.viewModel.orderType = index;
            }
            
            
            NBLScrollTabItem *contentItem = [[NBLScrollTabItem alloc] init];
            contentItem.title = self.titleSource[i];
            contentItem.hideBadge = YES;//每个title可以做个性化配置
            contentItem.font = SYSTEMFONT(15);
            signal.tabItem = contentItem;
            [_viewControllers addObject:signal];
            [self addChildViewController:signal];
            UINavigationController *nav = signal.navigationController;
            NSLog(@"%@",nav);
        }
    }
    return _viewControllers;
}
#pragma mark - event
#pragma mark - method
-(void)initilization
{
    self.navigationItem.title = @"我的采购订单";
    self.automaticallyAdjustsScrollViewInsets = NO;
    self.edgesForExtendedLayout = UIRectEdgeNone;
    
    self.navigationController.navigationBar.shadowImage = [[UIImage new]rt_darkenWithLevel:0.3f];
    [self setNavgationTheme:1];
    [self addChildViewController:self.segmentTV];
    [self.view addSubview:self.segmentTV.view];
}
#pragma mark - life
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self initilization];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/
#pragma mark - delegate
#pragma mark - segment delegate
- (void)tabController:(NBLScrollTabController * __nonnull)tabController
didSelectViewController:( UIViewController * __nonnull)viewController
{
    
}
@end


/*
 11111111111111111111111111111111111111001111111111111111111111111
 11111111111111111111111111111111111100011111111111111111111111111
 11111111111111111111111111111111100001111111111111111111111111111
 11111111111111111111111111111110000111111111111111111111111111111
 11111111111111111111111111111000000111111111111111111111111111111
 11111111111111111111111111100000011110001100000000000000011111111
 11111111111111111100000000000000000000000000000000011111111111111
 11111111111111110111000000000000000000000000000011111111111111111
 11111111111111111111111000000000000000000000000000000000111111111
 11111111111111111110000000000000000000000000000000111111111111111
 11111111111111111100011100000000000000000000000000000111111111111
 11111111111111100000110000000000011000000000000000000011111111111
 11111111111111000000000000000100111100000000000001100000111111111
 11111111110000000000000000001110111110000000000000111000011111111
 11111111000000000000000000011111111100000000000000011110001111111
 11111110000000011111111111111111111100000000000000001111100111111
 11111111000001111111111111111111110000000000000000001111111111111
 11111111110111111111111111111100000000000000000000000111111111111
 11111111111111110000000000000000000000000000000000000111111111111
 11111111111111111100000000000000000000000000001100000111111111111
 11111111111111000000000000000000000000000000111100000111111111111
 11111111111000000000000000000000000000000001111110000111111111111
 11111111100000000000000000000000000000001111111110000111111111111
 11111110000000000000000000000000000000111111111110000111111111111
 11111100000000000000000001110000001111111111111110001111111111111
 11111000000000000000011111111111111111111111111110011111111111111
 11110000000000000001111111111111111100111111111111111111111111111
 11100000000000000011111111111111111111100001111111111111111111111
 11100000000001000111111111111111111111111000001111111111111111111
 11000000000001100111111111111111111111111110000000111111111111111
 11000000000000111011111111111100011111000011100000001111111111111
 11000000000000011111111111111111000111110000000000000011111111111
 11000000000000000011111111111111000000000000000000000000111111111
 11001000000000000000001111111110000000000000000000000000001111111
 11100110000000000001111111110000000000000000111000000000000111111
 11110110000000000000000000000000000000000111111111110000000011111
 11111110000000000000000000000000000000001111111111111100000001111
 11111110000010000000000000000001100000000111011111111110000001111
 11111111000111110000000000000111110000000000111111111110110000111
 11111110001111111100010000000001111100000111111111111111110000111
 11111110001111111111111110000000111111100000000111111111111000111
 11111111001111111111111111111000000111111111111111111111111100011
 11111111101111111111111111111110000111111111111111111111111001111
 11111111111111111111111111111110001111111111111111111111100111111
 11111111111111111111111111111111001111111111111111111111001111111
 11111111111111111111111111111111100111111111111111111111111111111
 11111111111111111111111111111111110111111111111111111111111111111
 
 
 */
